var app = angular.module('ZJPC');

app.controller('FaceDetailController', ['$scope', '$state','$uibModalInstance', '$http', 'DataService','data', function($scope, $state, $uibModalInstance, $http, DataService,data) {

	$scope.cancel = function() {
      $uibModalInstance.dismiss('cancel');
    };

    $scope.data= data;

    console.log(data)
    $scope.showLoading = true;
    DataService.getPerson(data.xhgh,function(result){
        $scope.showLoading = false;
    	console.log(result)
    	$scope.type = result.rylx=='学生'?'student':(result.rylx=='老师'?'teacher':'outer');
    	$scope.info = result;
    })

    $scope.baseInfo = function(){
		var url = $state.href('app.file.perfile.basic',{xm:data.xm,jid:data.xhgh});
	  	window.open(url,'_blank');
	}

}]);
